package Marks.Webshop.Database.config;

import Marks.Webshop.Database.dao.AbstractDao;

public class SideDatas<T extends AbstractDao> {
	
	private int itemsPerPage;
	
	private T dao;
	
	private int maxPageNumber;
	
	private int maxItemNumber;
	
	SideDatas(int ipp, T dao){
		this.itemsPerPage = ipp;
		this.dao = dao;
		this.maxItemNumber = this.dao.findAll().size();
		this.maxPageNumber = this.maxItemNumber / this.itemsPerPage;
	}

	public int getItemsPerPage() {
		return itemsPerPage;
	}

	public void setItemsPerPage(int itemsPerPage) {
		this.itemsPerPage = itemsPerPage;
	}

	public int getMaxPageNumber() {
		return maxPageNumber;
	}

	public int getMaxItemNumber() {
		return maxItemNumber;
	}
	
}
